package dk.redia.lib.model;

import android.os.Parcel;
import android.os.Parcelable;

public class GeoLocation implements Parcelable {

	private String name;
	private String description;
	private String street;
	private String building;
	private String postal;
	private String city;
	private float latitude;
	private float longitude;
	
	public GeoLocation() {
		name = "";
		description = "";
		street = "";
		building = "";
		postal = "";
		city = "";
		latitude = 56.172115000000005f;
		longitude = 10.188260000000007f;
	}
	
	public String getName() {
		return name;
	}
	
	public String getDescription() {
		return description;
	}
	
	public String getStreet() {
		return street;
	}
	
	public String getBuilding() {
		return building;
	}
	
	public String getPostal() {
		return postal;
	}
	
	public String getCity() {
		return city;
	}
	
	public float getLatitude() {
		return latitude;
	}
	
	public float getLongitude() {
		return longitude;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	public void setStreet(String street) {
		this.street = street;
	}
	
	public void setBuilding(String building) {
		this.building = building;
	}
	
	public void setPostal(String postal) {
		this.postal = postal;
	}
	
	public void setCity(String city) {
		this.city = city;
	}
	
	public void setLatitude(float lat) {
		latitude = lat;
	}
	
	public void setLongitude(float lng) {
		longitude = lng;
	}
	
	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(getName());
		dest.writeString(getDescription());
		dest.writeString(getStreet());
		dest.writeString(getBuilding());
		dest.writeString(getPostal());
		dest.writeString(getCity());
		dest.writeFloat(getLatitude());
		dest.writeFloat(getLongitude());
	}
	
	public static final Parcelable.Creator<GeoLocation> CREATOR = new Parcelable.Creator<GeoLocation>() {
		public GeoLocation createFromParcel(Parcel source) {
			GeoLocation io = new GeoLocation();
			io.setName(source.readString());
			io.setDescription(source.readString());
			io.setStreet(source.readString());
			io.setBuilding(source.readString());
			io.setPostal(source.readString());
			io.setCity(source.readString());
			io.setLatitude(source.readFloat());
			io.setLongitude(source.readFloat());
			return io;
		}
		
		public GeoLocation[] newArray(int size) {
			return new GeoLocation[size];
		}		
	};
}